﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_Location : System.Web.UI.UserControl
{
    int _city;
    public int City
    {
        get
        {
            if (_city < 1) _city = Convert.ToInt32(ddl_Location.SelectedValue);
            return _city;
        }
        set
        {
            _city = value;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (_city > 0)
            {
                ddl_Location.DataBind();
                ddl_Location.SelectedValue = _city.ToString();
            }
        }
    }
    protected void ddl_Location_SelectedIndexChanged(object sender, EventArgs e)
    {
        _city = Convert.ToInt32(ddl_Location.SelectedValue);
    }
}
